<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>20_案例练习-输出数组中最小的值</title>
    </head>
    <body>
        <script>
            var arr = [6,5,3,1,8,7,2,4];

            var min = arr[0];

            for(var i = 1; i < arr.length; i++) {
                if(min > arr[i]) {
                    min = arr[i];
                }
            }
            console.log(min);
        </script>
    </body>
</html>